package com.jt.spring.demo1.proxy;

import com.jt.spring.demo1.config.SpringComfig;
import com.jt.spring.demo1.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestTx {
    public static void main(String[] args) {
        ApplicationContext context=
        new AnnotationConfigApplicationContext(SpringComfig.class);
        UserService userService = context.getBean(UserService.class );
        UserService proxy = (UserService) JDKProxy.getProxy(userService);
        proxy.addUser();
    }
}
